<!doctype html>
<html lang= "en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">



<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>我的课题</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link th:href="@{/assets/i/favicon.png}" rel="icon" type="image/png" href="../static/assets/i/favicon.png">
    <link th:href="@{/assets/i/app-icon72x72@2x.png}"  rel="apple-touch-icon-precomposed" href="../static/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link th:href="@{/assets/css/amazeui.min.css}" rel="stylesheet" href="../static/assets/css/amazeui.min.css" />
    <link th:href="@{/assets/css/admin.css}" rel="stylesheet" href="../static/assets/css/admin.css">
    <link th:href="@{/assets/css/app.css}" rel="stylesheet" href="../static/assets/css/app.css">
    <link th:href="@{/css/bootstrap.min.css}" href="../static/css/bootstrap.min.css" rel="stylesheet">

    <link th:href="@{/css/bootstrap.min.css}" href="../static/css/bootstrap.min.css" rel="stylesheet">


</head>

<body  style="">


<div th:replace="thead-top :: thead-top"></div>

<div class="tpl-page-container tpl-page-header-fixed">

    <div class="tpl-left-nav tpl-left-nav-hover">
        <div class="tpl-left-nav-title">
            <font size="4">毕设管理系统</font>
        </div>
        <div class="tpl-left-nav-list">
            <ul class="tpl-left-nav-menu">
                <li class="tpl-left-nav-item">
                    <a href="index.php" class="nav-link active" th:href="@{/admin}">
                        <i class="am-icon-home"></i>
                        <span>首页</span>
                        <i class="am-icon-star tpl-left-nav-content-ico am-fr am-margin-right"></i>
                    </a>
                </li>
                <!--<li class="tpl-left-nav-item">-->
                <!--<a href="course.php" class="nav-link tpl-left-nav-link-list">-->
                <!--<i class="am-icon-book"></i>-->
                <!--<span>论文审评</span>-->
                <!--</a>-->
                <!--</li>-->
                <li class="tpl-left-nav-item">
                    <a href="javascript:;" class="nav-link tpl-left-nav-link-list">
                        <i class="am-icon-align-justify"></i>
                        <span>课题管理</span>
                        <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                    </a>
                    <ul class="tpl-left-nav-sub-menu" style="display: block;">
                        <li>
                            <a href="kadai.html" th:href="@{/admin/a_pending}">
                                <i class="am-icon-angle-right"></i>
                                <span>课题审核</span>
                            </a>

                            <a href="newKadai.html" th:href="@{/admin/a_kadai}">
                                <i class="am-icon-angle-right"></i>
                                <span>课题管理</span>
                            </a>


                        </li>
                    </ul>
                </li>

                <li class="tpl-left-nav-item">
                    <a href="javascript:;" class="nav-link tpl-left-nav-link-list">
                        <i class="am-icon-align-justify"></i>
                        <span>选题管理</span>
                        <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                    </a>
                    <ul class="tpl-left-nav-sub-menu" style="display: block;">
                        <li>

                            <a href="a_kadaiOpenAndClose.html" th:href="@{/admin/a_kadaiOpenAndClose}" >
                                <i class="am-icon-angle-right"></i>
                                <span>开启/关闭选题</span>
                            </a>

                            <a href="a_kadaiorder.html" th:href="@{/admin/a_kadaiorder}" >
                                <i class="am-icon-angle-right"></i>
                                <span>指定课题</span>
                            </a>


                        </li>
                    </ul>
                </li>

                <li class="tpl-left-nav-item">
                    <a href="javascript:;" class="nav-link tpl-left-nav-link-list">
                        <i class="am-icon-align-justify"></i>
                        <span>论文评审</span>
                        <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                    </a>
                    <ul class="tpl-left-nav-sub-menu" style="display: block;">
                        <li>
                            <a href="" th:href="@{/admin/areview}">
                                <i class="am-icon-angle-right"></i>
                                <span>安排开题交叉评阅</span>
                            </a>



                            <a href="" th:href="@{/admin/crossproposal}">
                                <i class="am-icon-angle-right"></i>
                                <span>安排论文交叉评阅</span>
                            </a>


                            <a href="#" th:href="@{/admin/allgrades}">
                                <i class="am-icon-angle-right"></i>
                                <span>学生成绩</span>
                            </a>

                        </li>
                    </ul>
                </li>

                <li class="tpl-left-nav-item">
                    <a href="javascript:;" class="nav-link tpl-left-nav-link-list">
                        <i class="am-icon-align-justify"></i>
                        <span>用户管理</span>
                        <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                    </a>
                    <ul class="tpl-left-nav-sub-menu" style="display: block;">
                        <li>
                            <a href="#" th:href="@{/admin/newstudent}">
                                <i class="am-icon-angle-right"></i>
                                <span>添加学生</span>
                            </a>

                            <a href="#" th:href="@{/admin/newteacher}">
                                <i class="am-icon-angle-right"></i>
                                <span>添加老师</span>
                            </a>

                        </li>
                    </ul>
                </li>

            </ul>
        </div>
    </div>

     <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">

            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">管理员</a></li>
                <li><a href="#">选题管理</a></li>
                <li class="am-active">指定课题</li>
            </ol>

            <div class="tpl-portlet-components">
               
                <div class="tpl-block">
                    <div class="am-g">
                        <div class="am-u-sm-12 am-u-md-6">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    
                                </div>
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-6">
                            <div class="am-form-group">
                       
                            </div>
                        </div>


                        <div class="am-u-sm-12 am-u-md-3">

                            <div class="am-input-group am-input-group-sm">

                                    <form th:action="@{/admin/a_TaskAppoint}" action="/admin/a_TaskAppoint"  method="post">
                                        <input type="text" class="am-form-field" id="stu_id" name="stu_id" value="">
                                        <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="submit"></button>
                                    </form>
                            </div>

                        </div>
                    </div>
                </div>
<!--list1-->
                <div class="am-g">
                    <div class="am-u-sm-12">
                        <table id="table1" class="am-table am-table-striped am-table-hover table-main">


                            <!--删除模态框-->
                            <div class="modal fade" id="delModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                <div class="modal-dialog" style="margin-top: 100px;">
                                    <div class="modal-content" style="text-align:center;">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal"
                                                    aria-hidden="true">×
                                            </button>
                                            <h9 class="modal-title" id="myModalLabel">选择课题</h9>
                                        </div>
                                        <div class="modal-body">
                                            <p style="font-size: smaller;">确定为学生退选该课题吗？</p>
                                            <form th:action="@{/admin/a_SkadaiDel}" action="/admin/a_SkadaiDel"  method="post">
                                                <input type="hidden" id="stu_idDel" name="stu_idDel" value=""/>
                                                <button type="button" class="am-btn am-btn-primary" data-dismiss="modal">取消</button>
                                                <button type="submit" class="am-btn am-btn-primary" >确认</button>
                                            </form>
                                        </div>
                                        <div class="modal-footer">
                                        </div>
                                    </div>
                                </div><!-- /.modal-content -->
                            </div><!-- /.modal-dialog -->


                        <thead>
                        <tr>
                            <th class="table-check"><input type="checkbox" class="tpl-table-fz-check"></th>
                            <th class="table-id">学号</th>
                            <th class="table-title">学生姓名</th>
                            <th class="table-title">课题编号</th>
                            <th class="table-title">课题名称</th>
                            <th class="table-set">操作</th>
                        </tr>
                        </thead>

                        <tbody>
                        <tr id ="list1" th:each="task,list1:${initdata1}">
                            <td><input type="checkbox"></td>
                            <td id="table_stuidone" th:text="${task.stuid}"  ></td>
                            <td id="table_stunameone" th:text="${task.stuname}"  ></td>
                            <td id="table_taskidone" th:text="${task.taskid}"  ></td>
                            <td id="table_tasknameone" th:text="${task.taskname}"></td>
                            <td>
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <!--<button id ="show"  data-toggle='modal' data-target='#showModal' class="am-btn am-btn-default am-btn-xs am-text-center" onclick="show(this)"><span class="am-icon-angle-double-up"></span> 详情</button>-->
                                        <button id="delete1" data-toggle='modal' data-target='#delModal' class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" onclick= "del(this)"><span class="am-icon-arrow-circle-o-down"></span> 退选</button>
                                        <!--<button id='button1' class="am-btn  am-btn-default am-icon-adn" type="button">选题</button>-->
                                    </div>
                                </div>
                            </td>

                        </tr>
                        <!--<script>-->
                            <!--function del(obj) {-->
                                <!--task = $(obj).parents("tr").find("#table_taskid").text();-->
                                <!--document.getElementById("del_taskid").value= task;-->
                            <!--}-->


                            <!--$(document).ready(function(){-->
                                <!--$("#button1").click(function(){-->

                                <!--});-->
                            <!--});-->
                        <!--</script>-->

                        </tbody>
                    </table>
                    </div>
                </div>
<!--list2-->
                <div class="am-g">
                    <div class="am-u-sm-12">
                        <!--<form class="am-form">-->

                        <!--选课模态框-->
                        <div class="modal fade" id="addtoStuModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                            <div class="modal-dialog" style="margin-top: 100px;">
                                <div class="modal-content" style="text-align:center;">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal"
                                                aria-hidden="true">×
                                        </button>
                                        <h7 class="modal-title" id="myModalLabel">选择</h7>
                                    </div>
                                    <div class="modal-body">
                                        <p style="font-size: smaller;">您要为学生添加该课题吗？</p>
                                        <form th:action="@{/admin/addKadaiToStu}" action="/admin/addKadaiToStu"  method="post">
                                            <input type="hidden" id="add_taskid" name="add_taskid" value="1"/>
                                            <input type="hidden" id="add_taskname" name="add_taskname" value="222"/>
                                            <input type="hidden" id="add_stuid" name="add_stuid" value=""/>

                                            <button type="button" class="am-btn am-btn-primary" data-dismiss="modal">取消</button>
                                            <button type="submit" class="am-btn am-btn-primary" >确认</button>
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                    </div>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->

                        <!--查看课题详情模态框-->
                        <div class="modal fade" id="showModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                            <div class="modal-dialog" style="margin-top: 100px;">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal"
                                                aria-hidden="true">×
                                        </button>
                                        <h9 class="modal-title" id="myModalLabel">课题详情</h9>
                                    </div>
                                    <div class="modal-body">
                                        <form th:action="@{/admin/checktask}" action="/admin/checktask"  method="post">
                                            <input type="hidden" id="edit_task" name="edit_task" value="555"/>

                                            <div class="form-group form-inline" style="margin-bottom: auto;">
                                                <label for="show_taskid">课题编号</label>
                                                <input type="text" id ="show_taskid" value="" readonly="readonly">
                                            </div>

                                            <div class="form-group form-inline" style="margin-bottom: auto;">
                                                <label for="show_taskname">课题名称</label>
                                                <input type="text" id ="show_taskname" value="" readonly="readonly">
                                            </div>

                                            <div class="form-group form-inline" style="margin-bottom: auto;">
                                                <label for="show_tutorname">课题导师</label>
                                                <input type="text" id ="show_tutorname" value="" readonly="readonly">
                                            </div>

                                            <div class="form-group form-inline" style="margin-bottom: auto;">
                                                <label for="show_tasktype">课题类型</label>
                                                <input type="text" id ="show_tasktype" value="" readonly="readonly">
                                            </div>

                                            <div class="form-group form-inline" style="margin-bottom: auto;">
                                                <label for="show_taskrate">课题级别</label>
                                                <input type="text" id ="show_taskrate" value="" readonly="readonly">
                                            </div>

                                            <div class="form-group form-inline">
                                                <label for="show_taskdescrib">课题描述</label>
                                                <input type="text" id ="show_taskdescrib" value="" readonly="readonly">
                                            </div>

                                            <button type="button" class="am-btn am-btn-primary" data-dismiss="modal">关闭</button>

                                            <!--<button type="submit" class="btn btn-primary" >选课</button>-->
                                            <!--<button type="button" id="addTask" class="btn btn-primary" data-toggle='modal' data-target='#addtomyModal'onclick="add(this)">选课</button>-->
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                    </div>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->

                        <table id="mainTable" class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr>
                                <!--<th>ID</th>-->
                                <th class="table-check"><input type="checkbox" class="tpl-table-fz-check"></th>
                                <th>课题编号</th>
                                <th>课题名称</th>
                                <!--           <th>学生姓名</th> -->
                                <th>导师姓名</th>
                                <!--<th>状态</th>-->
                                <th>查看详情</th>
                                <th>选题选择</th>
                                <!--<th>删除</th>-->
                            </tr>
                            </thead>

                            <tbody>

                            <tr id ="list2" th:each="task,list2:${initdata2}">
                                <th class="table-check"><input type="checkbox" class="tpl-table-fz-check"></th>
                                <!--<td id="table_id" th:text="${list.size+1}"></td>-->
                                <td id="table_taskidtwo" th:text="${task.taskid}" class="table_taskid" ></td>
                                <td id="table_tasknametwo" th:text="${task.taskname}"></td>
                                <td id="table_tutornametwo" th:text="${task.tutorname}"></td>
                                <!--<td id="table_taskstate" th:text="${task.taskstate}"></td>-->
                                <td style="display:none" id="table_tasktypetwo" th:text="${task.tasktype}"></td>
                                <td style="display:none" id="table_taskratetwo" th:text="${task.taskrate}"></td>
                                <td style="display:none" id="table_taskdescribtwo" th:text="${task.taskdescrib}"></td>
                                <td style="display:none" id="table_taskmaxchoosetwo" th:text="${task.taskmaxchoose}"></td>
                                <td><button id="showtwo" class='btn btn-link' data-toggle='modal'  data-target='#showModal' onclick="show(this)">查看详情</button></td>
                                <!--<td><button id="addtomy" class='btn btn-link' data-toggle='modal' data-target='#addtomyModal' onclick="add(this)">选题</button></td>-->
                                <td><button  id="addtoStutwo" onclick="add(this)" data-toggle='modal' data-target='#addtoStuModal' class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-adjust"></span> 选择</button>

                                    <!--<td><button id="delete" class='btn btn-link'  data-toggle='modal' data-target='#delModal' >删除</button></td>-->
                                    <!--<td><button id="delete" class='btn btn-link'  data-toggle='modal' data-target='#delModal' onclick="del(this)" >删除</button></td>-->
                            </tr>
                            <input type="hidden" id="flag" value="0">


                            </tbody>
                        </table>

                        <hr>

                        </form>
                        <!--</div>-->

                    </div>
                </div>


            </div>
     </div>



</div>
<script type="text/javascript">
    /**
     * 选题
     */
    function add(obj) {
        document.getElementById("add_taskid").value = $(obj).parents("tr").find("#table_taskidtwo").text();
        document.getElementById("add_taskname").value = $(obj).parents("tr").find("#table_tasknametwo").text();
        // document.getElementById("add_stuid").value =$(obj).find("#table_stuidone").text().value();
        // document.getElementById("add_stuid").value = $("#table1 tr:eq(1) td:eq(1) ").text();
        document.getElementById("add_stuid").value = $("#table1 tr:eq(1) td:nth-child(2)").text();
        // document.getElementById("add_stuid").value =$(obj).parents("tr").find("#table_taskidtwo").text();
    }


        /**
     * 查看课题详情
     */
    function show(obj) {
        document.getElementById("edit_task").value=$(obj).parents("tr").find("#table_taskidtwo").text();
        document.getElementById("show_taskid").value=$(obj).parents("tr").find("#table_taskidtwo").text();
        document.getElementById("show_taskname").value=$(obj).parents("tr").find("#table_tasknametwo").text();
        document.getElementById("show_tasktype").value=$(obj).parents("tr").find("#table_tasktypetwo").text();
        document.getElementById("show_taskrate").value=$(obj).parents("tr").find("#table_taskratetwo").text();
        document.getElementById("show_tutorname").value=$(obj).parents("tr").find("#table_tutornametwo").text();
        document.getElementById("show_taskdescrib").value=$(obj).parents("tr").find("#table_taskdescribtwo").text();}

        /**
         * 取消学生的原选题
         * @param obj
         */

    function del(obj) {
        document.getElementById("stu_idDel").value= $(obj).parents("tr").find("#table_stuidone").text();
    }

</script>

    <script th:src="@{/assets/js/jquery.min.js}" src="../static/assets/js/jquery.min.js"></script>
    <script th:src="@{/assets/js/amazeui.min.js}" src="../static/assets/js/amazeui.min.js"></script>
    <script th:src="@{/assets/js/app.js}" src="../static/assets/js/app.js"></script>

    <script th:src="@{/js/bootstrap.min.js}" src="../static/js/bootstrap.min.js"></script>
    <script th:src="@{/js/jquery-3.1.1.min.js}" src="../static/js/jquery-3.1.1.min.js"></script>
    <script th:src="@{/js/flat-ui.min.js}" src="../static/js/flat-ui.min.js"></script>

</body>

</html>
<script src="//cdn.bootcss.com/jquery/3.0.0-beta1/jquery.min.js"></script>
<script src="//cdn.bootcss.com/jqgrid/4.6.0/js/i18n/grid.locale-en.js"></script>
<script src="//cdn.bootcss.com/jqgrid/4.6.0/js/jquery.jqGrid.min.js"></script>
